package cn.liutao.upload.api;

import cn.liutao.common.enums.CommonEnum;
import lombok.extern.slf4j.Slf4j;

import javax.servlet.annotation.WebServlet;
import java.text.SimpleDateFormat;
import java.util.Date;

@WebServlet("/upload/dish")
@Slf4j
public class DishUploadServlet extends UploadServlet {

    private static final String path = CommonEnum.DISH_UPLOAD_DIRECTORY.getValue();

    @Override
    public String getUploadPath(String uploadPath) {
        String sdf = new SimpleDateFormat("yyyyMM").format(new Date());
        return uploadService.concat(path, sdf);
    }
}
